package chess;

import java.util.List;



public class King extends Figure {

	



	King(int a, int b, int c) 
	{
		super(a, b, c);
	}

	public List move()
	{
		if(y==0 && x==0)
		{
			listmove.add(new Area(x,y+1));
			listmove.add(new Area(x+1,y));
			listmove.add(new Area(x+1,y+1));
		}
		else if(y==Board.height && x==Board.width)
		{
			listmove.add(new Area(x,y-1)); 
			listmove.add(new Area(x-1,y));
			listmove.add(new Area(x-1,y-1));
		}
		else if(y==Board.height && x==0)
		{
			listmove.add(new Area(x,y-1)); 
			listmove.add(new Area(x+1,y));
			listmove.add(new Area(x+1,y-1));
		}
		else if(y==0 && x==Board.width)
		{
			listmove.add(new Area(x,y+1));
			listmove.add(new Area(x-1,y));
			listmove.add(new Area(x-1,y+1));
		}
			
		else 
		{
			listmove.add(new Area(x,y+1));
			listmove.add(new Area(x,y-1));
			listmove.add(new Area(x+1,y));
			listmove.add(new Area(x-1,y));
			listmove.add(new Area(x+1,y+1));
			listmove.add(new Area(x+1,y-1));
			listmove.add(new Area(x-1,y+1));
			listmove.add(new Area(x-1,y-1));
		}
		
		return listmove;
	}
}
